package edu.cicese.alz.swing;

import javax.swing.JTextField;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

/**
 * Created by: Eduardo Quintana Contreras
 * Date: 9/07/12
 * Time: 04:55 PM
 */
public class SynchronizeListener implements FocusListener {
	private JTextField textField1, textField2;

	public SynchronizeListener(JTextField textField1, JTextField textField2) {
		this.textField1 = textField1;
		this.textField2 = textField2;
	}

	@Override
	public void focusGained(FocusEvent e) {
	}

	@Override
	public void focusLost(FocusEvent e) {
		textField2.setText(textField1.getText());
	}
}
